/*! * MorphSVGPlugin 3.2.4 * https://greensock.com * * @license Copyright 2020, GreenSock. All rights reserved. * Subject to the terms at https://greensock.com/standard-license or for Club GreenSock members, the agreement issued with that membership. * @author: Jack Doyle, jack@greensock.com */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).window=t.window||{})}(this,function(t){"use strict";function m(t){return"string"==typeof t}var M=/[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,A=/(?:(-)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,b=/[\+\-]?\d*\.?\d+e[\+\-]?\d+/gi,n=/(^[#\.][a-z]|[a-y][a-z])/i,D=Math.PI/180,E=Math.sin,k=Math.cos,Z=Math.abs,$=Math.sqrt,h=function _isNumber(t){return"number"==typeof t},s=function _round(t){return Math.round(1e5*t)/1e5||0};function reverseSegment(t){var e,r=0;for(t.reverse();rf[0].length&&X(f[0],(u[0].length-f[0].length)/6|0),v=f.length;dMath.abs(a[0]-i[i.length-2])+Math.abs(a[1]-i[i.length-1])+Math.abs(a[a.length-2]-i[0])+Math.abs(a[a.length-1]-i[1])||r%2)?(reverseSegment(i),y[v]=-1,w=!0):"auto"===r?y[v]=0:"reverse"===r&&(y[v]=-1),i.closed!==a.closed&&(i.closed=a.closed=!1));return x&&L("shapeIndex:["+y.join(",")+"]"),t.shapeIndex=y}}function _(t,e){var r,n,o,a,i,h,s,l=0,g=parseFloat(t[0]),c=parseFloat(t[1]),p=g+","+c+" ";for(r=.5*e/(.5*(o=t.length)-1),n=0;nd?o:a,sl:g,cl:v(s*s+l*l)-g,i:r}}function ia(t){r=y(),o=o||r&&r.plugins.morphSVG,r&&o?(C=r.utils.toArray,o.prototype._tweenRotation=ha,I=1):t&&L("Please gsap.registerPlugin(MorphSVGPlugin)")}var r,C,F,I,o,w=Math.atan2,x=Math.cos,j=Math.sin,v=Math.sqrt,p=Math.PI,u=2*p,f=.3*p,d=.7*p,G=/[-+=\.]*\d+[\.e\-\+]*\d*[e\-\+]*\d*/gi,q=/(^[#\.][a-z]|[a-y][a-z])/gi,H=/[achlmqstvz]/gi,B="Use MorphSVGPlugin.convertToPath() to convert to a path before morphing.",J={version:"3.2.4",name:"morphSVG",register:function register(t,e){r=t,o=e,ia()},init:function init(t,e,r,n,o){var a,i,h,s,l,g,c,p,u,f,d,_,m,v,y,w,x,T,M,b,S,N,R=t.nodeType?window.getComputedStyle(t):{},A=R.fill+"",z=!("none"===A||"0"===(A.match(G)||[])[3]||"evenodd"===R.fillRule),O=(e.origin||"50 50").split(",");if(I||ia(1),l="POLYLINE"===(a=(t.nodeName+"").toUpperCase())||"POLYGON"===a,"PATH"!==a&&!l&&!e.prop)return L("Cannot morph a <"+a+"> element. "+B),!1;if(i="PATH"===a?"d":"points",("string"==typeof e||e.getBBox||e[0])&&(e={shape:e}),!e.prop&&"function"!=typeof t.setAttribute)return!1;if(s=function _parseShape(t,e,r){var n,o;return(!("string"==typeof t)||q.test(t)||(t.match(G)||[]).length<3)&&((n=C(t)[0])?(o=(n.nodeName+"").toUpperCase(),e&&"PATH"!==o&&(n=convertToPath(n,!1),o="PATH"),t=n.getAttribute("PATH"===o?"d":"points")||"",n===r&&(t=n.getAttributeNS(null,"data-original")||t)):(L("WARNING: invalid morph to: "+t),t=!1)),t}(e.shape||e.d||e.points||"","d"==i,t),l&&H.test(s))return L("A <"+a+"> cannot accept path data. "+B),!1;if(g=e.shapeIndex||0===e.shapeIndex?e.shapeIndex:"auto",c=e.map||J.defaultMap,this._prop=e.prop,this._render=e.render||J.defaultRender,this._apply="updateTarget"in e?e.updateTarget:J.defaultUpdateTarget,this._rnd=Math.pow(10,isNaN(e.precision)?2:+e.precision),this._tween=r,s){if(this._target=t,x="object"==typeof e.precompile,f=this._prop?t[this._prop]:t.getAttribute(i),this._prop||t.getAttributeNS(null,"data-original")||t.setAttributeNS(null,"data-original",f),"d"==i||this._prop){if(f=stringToRawPath(x?e.precompile[0]:f),d=stringToRawPath(x?e.precompile[1]:s),!x&&!Y(f,d,g,c,z))return!1;for("log"!==e.precompile&&!0!==e.precompile||L('precompile:["'+rawPathToString(f)+'","'+rawPathToString(d)+'"]'),(S="linear"!==(e.type||J.defaultType))&&(f=da(f,e.smoothTolerance),d=da(d,e.smoothTolerance),f.size||P(f),d.size||P(d),b=ea(O[0]),this._origin=f.origin={x:f.left+b.x*f.width,y:f.top+b.y*f.height},O[1]&&(b=ea(O[1])),this._eOrigin={x:d.left+b.x*d.width,y:d.top+b.y*d.height}),this._rawPath=t._gsRawPath=f,m=f.length;-1<--m;)for(y=f[m],w=d[m],p=y.isSmooth||[],u=w.isSmooth||[],v=y.length,_=F=0;_ element or an SVG path data string")},stringToRawPath:stringToRawPath,rawPathToString:rawPathToString,pathFilter:function _pathFilter(t,e,r,n,o){var a=stringToRawPath(t[0]),i=stringToRawPath(t[1]);Y(a,i,e||0===e?e:"auto",r,o)&&(t[0]=rawPathToString(a),t[1]=rawPathToString(i),"log"!==n&&!0!==n||L('precompile:["'+t[0]+'","'+t[1]+'"]'))},pointsFilter:aa,getTotalSize:P,equalizeSegmentQuantity:Y,convertToPath:function convertToPath$1(t,e){return C(t).map(function(t){return convertToPath(t,!1!==e)})},defaultType:"linear",defaultUpdateTarget:!0,defaultMap:"size"};y()&&r.registerPlugin(J),t.MorphSVGPlugin=J,t.default=J;if (typeof(window)==="undefined"||window!==t){Object.defineProperty(t,"__esModule",{value:!0})} else {delete t.default}});